#ifndef IMAGELIST_H
#define IMAGELIST_H
#include "imagebase.h"
#include <QPainter>
#include <QWidget>


class ImageList
{

public:
    ImageList();
    ~ImageList();
    void setimagelist(int inum);
    int m_icurimgnum=0;
    int m_ishow=-1;

    //static QList<ImageBase>m_imagelist;
#define IMAGELISTNUM 30
    ImageBase m_imagelist[IMAGELISTNUM];

    QList<int> m_itrglist;
    int m_imagnum=IMAGELISTNUM;
    qint64 m_igarbnum=0;
    bool m_bini=false;
    static void init();
    void setgarb(){m_igarbnum=m_igarbnum+1;}
    qint64 getgarb(){return m_igarbnum;}

    ImageBase * getimage(int inum);

    ImageBase * nextimage();


    int getcurimgenum(){return m_icurimgnum;}
    int nextcurimgenum();
    void setcurimgenum(int icurnum){m_icurimgnum=icurnum;}

    int gettrg(int inum);
    void settrg(int inum,int ival);

    int waittrg(int inum,int isleeptime);

    void settoimage(void *pimage);
    int size(){return IMAGELISTNUM;}
    void setshow(int ishow){m_ishow = ishow;}
    int getshow(){return m_ishow;}
    void draw(QPainter &painter);
    void drawx(QPainter &painter,
               double dmovx,
               double dmovy,
               double dangle,
               double dzoomx,
               double dzoomy);
    void save();
    void savex();
    void load();
    void loadlist();
    void clearimage();
    void loadcalibx(const char *pfilename);
    void loadcaliby(const char *pfilename);
    void loadcalibz(const char *pfilename);

    int m_icurimage = 0;
    void getcurimage(int inum){m_icurimage = inum;}
    int curimage(){return m_icurimage;}
    int getposvaluex(int ix,int iy);
    int getposvaluey(int ix,int iy);
    int getposvaluez(int ix,int iy);
    void highvisionvalue(int ix,int iy,int iw);
};

#endif
